/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cctype>

using namespace std;

bool isUpperCyrillicLetter(char letter) {
    return (letter >= 1040 && letter <= 1071);
}

bool hasLatinCharacter(const std::string& word) {
    for(char c : word) {
        if(isalpha(c) && (c < 128 || c > 191)) {
            return true;
        }
    }
    return false;
}

int main() {
    string input;
    cout << "Введите слова, разделенные пробелом:";
    getline(std::cin, input);

    vector<string> words;
    string word;
    for(char c : input) {
        if(c == ' ') {
            if(!word.empty()) {
                words.push_back(word);
                word = "";
            }
        } else {
            word += c;
        }
    }
    if(!word.empty()) {
        words.push_back(word);
    }

    if(words.size() <= 1) {
        cout << "Мало данных для анализа" << endl;
        return 0;
    }

    int totalWords = words.size();
    int capitalCyrillic = 0;
    int latinChar = 0;
    int shortWords = 0;
    int wordsWithHyphen = 0;

    string longestWord = words[0];
    int longestWordLength = words[0].length();

    for(const string& w : words) {
        if(isUpperCyrillicLetter(w[0])) {
            capitalCyrillic++;
        }
        if(hasLatinCharacter(w)) {
            latinChar++;
        }
        if(w.length() <= 3) {
            shortWords++;
        }
        if(w.find('-') != string::npos) {
            wordsWithHyphen++;
        }
        if(w.length() > longestWordLength) {
            longestWord = w;
            longestWordLength = w.length();
        }
    }

    std::cout << "Количество слов: " << totalWords << endl;
    std::cout << "Слова с заглавной кириллической буквы: " << capitalCyrillic << endl;
    std::cout << "Слова с латинскими символами: " << latinChar << endl;
    std::cout << "Короткие слова: " << shortWords << endl;
    std::cout << "Самое длинное слово: " << longestWord << endl;
    std::cout << "Длина самого длинного слова: " << longestWordLength << endl;
    std::cout << "Слова с дефисом: " << wordsWithHyphen << endl;

    return 0;
}